package com.example.demo.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.demo.entity.UOperation;
import com.example.demo.entity.vo.OperationVo;

import java.util.List;

/**
* <p>
*  服务类
* </p>
*
* @author cy
* @since 2020-10-10
*/
public interface UOperationService {

    /**
    * 分页查询UOperation
    *
    * @param page     当前页数
    * @param pageSize 页的大小
    * @param factor  搜索关键词
    * @return 返回mybatis-plus的Page对象,其中records字段为符合条件的查询结果
    * @author cy
    * @since 2020-10-10
    */
    Page<UOperation> listUOperationsByPage(int page, int pageSize, String factor);

    /**
    * 根据id查询UOperation
    *
    * @param id 需要查询的UOperation的id
    * @return 返回对应id的UOperation对象
    * @author cy
    * @since 2020-10-10
    */
    UOperation getUOperationById(int id);

    /**
     * 通过uid获得该用户的权限
     * @param uId
     * @return
     */
    List<Integer> getUOperationByUId(int uId);

    /**
    * 插入UOperation
    *
    * @param operationVo 需要插入的UOperation对象
    * @return 返回插入成功之后UOperation对象的id
    * @author cy
    * @since 2020-10-10
    */
    int insertUOperation(OperationVo operationVo);

    /**
    * 根据id删除UOperation
    *
    * @param id 需要删除的UOperation对象的id
    * @return 返回被删除的UOperation对象的id
    * @author cy
    * @since 2020-10-10
    */
    int deleteUOperationById(int id);

    /**
    * 根据id更新UOperation
    *
    * @param uOperation 需要更新的UOperation对象
    * @return 返回被更新的UOperation对象的id
    * @author cy
    * @since 2020-10-10
    */
    int updateUOperation(UOperation uOperation);
}
